<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            height: 10000px;
        }
        div{
            width: 200px;
            height: 200px;
            background-color: aquamarine;
            position: sticky;
            top: 0;
        }
    </style>

    <script>
        window.addEventListener('local',function (evt) {
            alert("用户已存在")
        })
    </script>

</head>
<body>
    <div></div>
</body>
</html>